﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class giao_dien_searchCategory : System.Web.UI.Page
{
    CategoryBus categoryBus = new CategoryBus();
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void txtSearch_Click(object sender, EventArgs e)
    {
        string idsearch = txtSearch.Text;
        if (idsearch.Equals(""))
        {
            Response.Write("Not empty");
        }
        else 
        {

            DataTable dt = categoryBus.GetCategoryDetailById(idsearch);
            listView.DataSource = dt;
            listView.DataBind();
        }

    }

    protected void btnDisplay_Click(object sender, EventArgs e)
    {
        DataTable dt = categoryBus.GetAllCategory();

        gridviewAllCategory.DataSource = dt;
        gridviewAllCategory.DataBind();
    }
}